/* Name : Main.c
* Purpose : Source code for Buzzer Interfacing with ATMEGA16.
* Author : GEMICATES
* Date : 18-07-2017
* Website : www.gemicates.org
* Revision : None
*/
#include<avr/io.h> // Header file
#include<avr/interrupt.h>
int main()
{
DDRC |= 0X80; // PC7 configured as output
DDRD &= 0XFC; // PD2 PD3 configured as input
SREG = 0X80; // Global Interrupt Enable
MCUCR = 0X0F; // Rising edge generates interrupt
GICR = 0XC0; // INT0 INT1 activated
while(1);
}
ISR(_VECTOR(1)) // External Interrupt Request 0
{
GIFR = 0XC0; // Interrupt Flag Clear
PORTC ^= (0x80);
}